package com.lancoo.znbkxx.teacher.aibkTestCoach.questionToEvaluation

import com.lancoo.znbkxx.teacher.aibkTestCoach.networkRequest.entity.QuesEvaluationDetail

object EvaluationDeatilIndexHelp {

    /*
* 获取小题位置index
* */
    fun SortIndex_return_ChildVpIndex(quesEvaluationDetail: QuesEvaluationDetail, sortIndex:String):Int{
        var childVpIndex = -1
        var ChildListSize = quesEvaluationDetail.ChildList.size
        outLoop@for(a in 0 until ChildListSize){
            childVpIndex += 1
            var ItemListSize = quesEvaluationDetail.ChildList[a].ItemList.size
            for(b in 0 until ItemListSize){
                var SortIndex = quesEvaluationDetail.ChildList[a].ItemList[b].SortIndex
                if(SortIndex == sortIndex){
                    break@outLoop
                }
            }
        }
        return childVpIndex
    }

    /*
    * 获取小题位置index
    * */
    fun ChildVpIndex_return_SortIndex(quesEvaluationDetail: QuesEvaluationDetail,childVpIndex:Int):String{
        var SortIndex = ""
        var ChildVpIndex = -1
        var ChildListSize = quesEvaluationDetail.ChildList.size
        outLoop@for(a in 0 until ChildListSize){
            var ItemListSize = quesEvaluationDetail.ChildList[a].ItemList.size
            for(b in 0 until ItemListSize){
                ChildVpIndex += 1
                if(ChildVpIndex == childVpIndex){
                    SortIndex = quesEvaluationDetail.ChildList[a].ItemList[b].SortIndex
                    break@outLoop
                }
            }
        }
        return SortIndex
    }

    fun ItemSortIndex_return_IndexA(quesEvaluationDetail: QuesEvaluationDetail, itemSortIndex:String):Int{
        var index_A = 0
        var ChildListSize = quesEvaluationDetail.ChildList.size
        outLoop@for(a in 0 until ChildListSize){
            var ItemListSize = quesEvaluationDetail.ChildList[a].ItemList.size
            for(b in 0 until ItemListSize){
                var ItemSortIndex = quesEvaluationDetail.ChildList[a].ItemList[b].ItemSortIndex
                if (ItemSortIndex.contains(itemSortIndex)) {
                    index_A = a
                    break@outLoop
                }
            }
        }
        return index_A
    }

    fun ItemSortIndex_return_IndexB(quesEvaluationDetail: QuesEvaluationDetail,itemSortIndex:String):Int{
        var index_B = 0
        var ChildListSize = quesEvaluationDetail.ChildList.size
        outLoop@for(a in 0 until ChildListSize){
            var ItemListSize = quesEvaluationDetail.ChildList[a].ItemList.size
            for(b in 0 until ItemListSize){
                var ItemSortIndex = quesEvaluationDetail.ChildList[a].ItemList[b].ItemSortIndex
                if (ItemSortIndex.contains(itemSortIndex)) {
                    index_B = b
                    break@outLoop
                }
            }
        }
        return index_B
    }

    fun ChildVpIndex_return_IndexA(quesEvaluationDetail: QuesEvaluationDetail,childVpIndex:Int):Int{
        var indexA = 0
        var ChildVpIndex = -1
        var ChildListSize = quesEvaluationDetail.ChildList.size
        outLoop@for(a in 0 until ChildListSize){
            var ItemListSize = quesEvaluationDetail.ChildList[a].ItemList.size
            for(b in 0 until ItemListSize){
                ChildVpIndex += 1
                if(ChildVpIndex == childVpIndex){
                    indexA = a
                    break@outLoop
                }
            }
        }
        return indexA
    }

    fun ChildVpIndex_return_IndexB(quesEvaluationDetail: QuesEvaluationDetail,childVpIndex:Int):Int{
        var indexB = 0
        var ChildVpIndex = -1
        var ChildListSize = quesEvaluationDetail.ChildList.size
        outLoop@for(a in 0 until ChildListSize){
            var ItemListSize = quesEvaluationDetail.ChildList[a].ItemList.size
            for(b in 0 until ItemListSize){
                ChildVpIndex += 1
                if(ChildVpIndex == childVpIndex){
                    indexB = b
                    break@outLoop
                }
            }
        }
        return indexB
    }


}